<template>
    <div>
        <div class="bom_tree_search clearfix">
            <div class="tip">
                <label class="title">机身号（SN）</label>
                <Input v-model.trim="code" placeholder="请输入编码" style="width: 200px"  @on-enter="searchFn" clearable/>
            </div>
            <div class="tip">
                <Button type="primary" @click="searchFn">查询</Button>
            </div>
        </div>
    </div>
    
</template>
<script>
export default {
    name:"search"
    ,data(){
        return{
            code: ''
        }
    }
    ,methods:{
        searchFn(){
            let t = this;
            if(t.code == ""){
                t.$Message.error({background: true,content: '请输入机身号'});
                return;
            }
            t.$emit("getCode",t.code);
        }
    }
    ,components:{
        
    }
}
</script>
<style lang="less">
    .bom_tree_search{
        margin: 10px 50px;
        .tip{
            margin-left: 15px;
            display: inline-block;
        }
        .title{
            margin-right: 15px;
            // line-height: 32px;
        }
        .btn{
            float: right;
        }
    }
</style>